using System;
using System.Windows.Forms;


namespace ReportViewer
{
    /// <summary>
    /// View the report
    /// </summary>
    public partial class ReportViewer : Form
    {
        #region properties

        /// <summary>
        /// Make available the Report Viewer to any calling methods
        /// </summary>
        public Microsoft.Reporting.WinForms.ReportViewer Report
        {
            get { return reportViewer1; }
            set { reportViewer1 = value; }
        }

        #endregion

        /// <summary>
        /// Initialize the Class
        /// </summary>
        public ReportViewer()
        {
            InitializeComponent();
        }

        /// <summary>
        /// override the Show form as we need to know if we are going to display the information or not depending on the configuration
        /// </summary>
        public new virtual void Show()
        {
            if (!Constants.VIEW_WEB_REPORT)
            {
                base.Show();
            }
            else
            {
                return;
            }
        }


        #region Form Objects

        private void ReportViewer_Load(object sender, EventArgs e)
        {
            reportViewer1.ShowParameterPrompts = true;
            reportViewer1.PromptAreaCollapsed = true;
            reportViewer1.ShowPromptAreaButton = true;
            reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
            reportViewer1.RefreshReport();
        }

        #endregion

    }
}